object Practise2 {
  def isPalindrome(s: String): Boolean = {
    // 去除空格并将字符串转换为小写，以便忽略大小写和空格的影响
    val cleanedString = s.replaceAll("\\s", "").toLowerCase()
    // 比较字符串和它的反转
    cleanedString == cleanedString.reverse
  }

  def main(args: Array[String]): Unit = {
    val testString1 = "A man a plan a canal Panama"
    val testString2 = "hello"

    println({isPalindrome(testString1)})
    println({isPalindrome(testString2)})
  }
}